<template>
	<view>
		<simple-toolbar title="资产-用户账户交易记录">
			<view>
				<el-button @click="navBack">返回</el-button>
				<el-button @click="confirm" type="primary" :disabled="success">确认</el-button>
			</view>
		</simple-toolbar>
		<view class="pad-base">
			<el-form :model="formData" :rules="rules" ref="formData" label-position="top">
				<el-form-item label="用户名" prop="user_name" required>
					<el-input v-model="formData.user_name" placeholder="请输入用户名"></el-input>
				</el-form-item>
				<el-form-item label="数量" prop="wallet">
					<el-input v-model="formData.wallet" placeholder="请输入金额"></el-input>
				</el-form-item>
				<el-form-item label="收益记录号" prop="wallet">
					<el-input v-model="formData.wallet" placeholder="请输入收益记录号"></el-input>
				</el-form-item><el-form-item label="提币记录号" prop="wallet">
					<el-input v-model="formData.wallet" placeholder="请输入提币记录号"></el-input>
				</el-form-item>
				<el-form-item label="类型" prop="autowithdraw" required>
					<el-radio v-model="formData.autowithdraw" :label="true">提币</el-radio>
					<el-radio v-model="formData.autowithdraw" :label="false">收益</el-radio>
				</el-form-item>
			</el-form>
		</view>
	</view>
</template>

<script>
	import {
		mapState
	} from 'vuex'
	import {
		applyExtract
	} from "../../../js_sdk/uni-admin/asset.js"

	export default {
		data() {
			return {
				success: false,
				formData: {
					autowithdraw: true
				},
				rules: {
					user_name: [{
						required: true,
						message: '请输入用户名',
						trigger: 'blur'
					}],
					wallet: [{
						required: true,
						message: '请输入金额',
						trigger: 'blur'
					}],
					last_name: [{
						required: true,
						message: '请输入收益记录号',
						trigger: 'blur'
					}],
					phone: [{
						required: true,
						message: '请输入提币记录号',
						trigger: 'blur'
					}],
				}
			}
		},
		computed: {
			...mapState('user', ['userInfo'])
		},
		methods: {
			confirm() {
				this.$refs.formData.validate(async valid => {
					if (!valid) return
					
					this.success = true
					setTimeout(() => {
						uni.navigateBack()
					}, 1000)
				});
			},
			navBack() {
				uni.navigateBack()
			}
		},
	}
</script>

<style>

</style>
